import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

## How to connect `NLUX` to ChatGPT
`NLUX` provides a built-in adapter for connecting to OpenAI's API, which you can use to connect to ChatGPT.

### Installation

<Tabs groupId="package" queryString>
    <TabItem value="npm" label="NPM">
        ```bash
        npm install @nlux/openai-react
        ```
    </TabItem>
    <TabItem value="yarn" label="Yarn">
        ```bash
        yarn add @nlux/openai-react
        ```
    </TabItem>
    <TabItem value="pnpm" label="PNPM">
        ```bash
        pnpm add @nlux/openai-react
        ```
    </TabItem>
</Tabs>

### Usage

```jsx
import {useUnsafeChatAdapter} from '@nlux/openai-react';

const Component = () => {
    const adapter = useUnsafeChatAdapter({
        [option name]: <option value>,
    });
}
```
